package com.cszy.yydqbfq.bean

import android.net.Uri
import org.litepal.crud.LitePalSupport

data class AudioItemBean(
    var id: Long = 0,  // 改为 var 并添加默认值
    var title: String = "",
    var artist: String = "",
    var duration: Long = 0,
    var size: Long = 0,
    var path: String = "",
    var uriString: String = "",  // 用 String 替代 Uri
    var isSelected: Boolean = false
) : LitePalSupport() {

    // 添加 Uri 的便捷访问方法
    fun getUri(): Uri = Uri.parse(uriString)
    fun setUri(uri: Uri) {
        uriString = uri.toString()
    }

    override fun toString(): String {
        return "AudioItem(id=$id, title='$title', artist='$artist', " +
                "duration=$duration, size=$size, path='$path', " +
                "uriString='$uriString', isSelected=$isSelected)"
    }
}